Skip to content

Fix compatibility with 2026.1#44

Open
CyrilleB79 wants to merge 3 commits intoaddonFactory:masterfrom
CyrilleB79:prep2026.1
Open

Fix compatibility with 2026.1#44
CyrilleB79 wants to merge 3 commits intoaddonFactory:masterfrom
CyrilleB79:prep2026.1

Conversation

@CyrilleB79
Copy link

@CyrilleB79 CyrilleB79 commented Feb 5, 2026

Issue

When trying to override compatibility with NVDA 2026.1beta1, an error occurs at startup and the add-on cannot load.
This is due to the fact thatversion_year has been moved in 2026.1.

Once this first issue is fixed, various deprecation warning can occur:

  1. Python Deprecation warning:
DEBUGWARNING - Python warning (22:07:38.937) - MainThread (8924):
C:\Users\cyril\AppData\Roaming\nvda\addons\instantTranslate\globalPlugins\instantTranslate\__init__.py:53: ```
DeprecationWarning: 'locale.getdefaultlocale' is deprecated and slated for removal in Python 3.15. Use setlocale(), getencoding() and getlocale() instead.
  lo_lang = getdefaultlocale()
  1. Older NVDA deprecation warning introduced in NVDA 2025.1:
DEBUGWARNING - Python warning (15:02:46.788) - MainThread (13456):
gui\nvdaControls.pyc:317: DeprecationWarning: gui.nvdaControls.MessageDialog is deprecated. Use gui.messageDialog.MessageDialog instead.
  1. Older NVDA deprecation warning introduced in NVDA 2023.2:
WARNING - gui.MainFrame._popupSettingsDialog (15:02:33.001) - MainThread (13456):
_popupSettingsDialog is deprecated, use popupSettingsDialog instead.
Stack trace:
  File "nvda.pyw", line 309, in <module>
  File "core.pyc", line 1060, in main
  File "wx\core.pyc", line 2254, in MainLoop
  File "wx\core.pyc", line 3425, in <lambda>
  File "gui\__init__.pyc", line 272, in _popupSettingsDialog

Solution

  • Rather than checking NVDA version, directly try to import speech.speech and else only import speech.
  • Regarding the Python deprecation: use getlocale() as recommended.
  • Regarding NVDA deprecation, use recommended replacements.

Tests

  • Tested translation, automatic translation and translation of last spoken text.
  • Tested the GUI dialog and checked that no warning is logged anymore.

@CyrilleB79
Copy link
Author

Note: while at it, I have also removed older deprectationdeprecation warnings.

@CyrilleB79
Copy link
Author

Issue

When trying to override compatibility with NVDA 2026.1beta1, an error occurs at startup and the add-on cannot load. This is due to the fact thatversion_year has been moved in 2026.1.

Once this first issue is fixed, various deprecation warning can occur:

  1. Python Deprecation warning:
DEBUGWARNING - Python warning (22:07:38.937) - MainThread (8924):
C:\Users\cyril\AppData\Roaming\nvda\addons\instantTranslate\globalPlugins\instantTranslate\__init__.py:53: ```
DeprecationWarning: 'locale.getdefaultlocale' is deprecated and slated for removal in Python 3.15. Use setlocale(), getencoding() and getlocale() instead.
  lo_lang = getdefaultlocale()
  1. Older NVDA deprecation warning introduced in NVDA 2025.1:
DEBUGWARNING - Python warning (15:02:46.788) - MainThread (13456):
gui\nvdaControls.pyc:317: DeprecationWarning: gui.nvdaControls.MessageDialog is deprecated. Use gui.messageDialog.MessageDialog instead.
  1. Older NVDA deprecation warning introduced in NVDA 2023.2:
WARNING - gui.MainFrame._popupSettingsDialog (15:02:33.001) - MainThread (13456):
_popupSettingsDialog is deprecated, use popupSettingsDialog instead.
Stack trace:
  File "nvda.pyw", line 309, in <module>
  File "core.pyc", line 1060, in main
  File "wx\core.pyc", line 2254, in MainLoop
  File "wx\core.pyc", line 3425, in <lambda>
  File "gui\__init__.pyc", line 272, in _popupSettingsDialog

Solution

  • Rather than checking NVDA version, directly try to import speech.speech and else only import speech.
  • Regarding the Python deprecation: use getlocale() as recommended.
  • Regarding NVDA deprecation, use recommended replacements.

Tests

  • Tested translation, automatic translation and translation of last spoken text.
  • Tested the GUI dialog and checked that no warning is logged anymore.
  • All these tests done with NVDA 2026.1beta6 and NVDA 2019.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant